// 计数器的 reducer
export default function countReducer(oldState = 0, action) {
  switch (action.type) {
    case 'ADD':
      return oldState + action.payload
    case 'SUB':
      return oldState - action.payload
    default:
      return oldState
  }
}
